using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EntityLogic : LuaBehivour
{
    Action LuaOnShow;
    Action LuaOnHide;

    public override void Init(string _luaName)
    {
        base.Init(_luaName);
        luaScriptEnv.Get("OnShow", out LuaOnShow);
        luaScriptEnv.Get("OnHide", out LuaOnHide);
    }

    public void OnShow()
    {
        LuaOnShow?.Invoke();
    }

    public void OnHide() 
    {
        LuaOnHide?.Invoke();    
    }

    protected override void ClearLua()
    {
        base.ClearLua();
        LuaOnShow = null;
        LuaOnHide = null;  
    }
}
